package com.example.error;

import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;

@ControllerAdvice
public class ErrorException {


    @ExceptionHandler
    public Object error(Exception e){

        return e.getMessage();
    }

}
